package com.zky.action;

import java.util.List;



import com.opensymphony.xwork2.ActionContext;
import com.zky.DAO.impl.ManagerDaoImp;
import com.zky.entity.Manager;

public class BackLoginAction extends ManagerDaoImp  {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public String verify;	
	public String manager;
	public String password;
	
	public String getVerify() {
		return verify;
	}

	public void setVerify(String verify) {
		this.verify = verify;
	}


	public String getManager() {
		return manager;
	}

	public void setManager(String manager) {
		this.manager = manager;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String checkRegisterName() {
		ActionContext ctx = ActionContext.getContext();
		 String pp = (String) ctx.getSession().get("rand");
		List<Manager> list = this.findAll1(manager, password);
		if ( list.size()!= 0&&list!=null&&pp.equals(verify)) {	
			ctx.getSession().put("manager", manager);
			return "success";
		} else {
			return "input";
		}
	}
	/*public String checkRegisterPsw(String regPsw) {
		List<Manager> list = this.findByPsw(regPsw);
		if (null == list || list.size() == 0) {
		
			return "密码错误！";
		} else {
			return "密码匹配";
		}
	}*/

	
	
	
}
